<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>BNF for DataQL.jj</TITLE>
</HEAD>
<BODY>
<H1 ALIGN=CENTER>BNF for DataQL.jj</H1>
<H2 ALIGN=CENTER>TOKENS</H2>
<TABLE>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// ------------------------------------------------------------------------------------------------

// Ignore comments
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; SKIP : {
&lt;C_SINGLE_COMMENT: "//" (~["\n","\r","\f"])* &lt;EOL&gt;&gt;
| &lt;C_MULTILINE_COMMENT: "/*" (~[])* "*/"&gt;
| &lt;SH_SINGLE_COMMENT: "#" (~["\n","\r","\f"])* &lt;EOL&gt;&gt;
| &lt;WHITESPACE: " " | "\t"&gt;
| &lt;EOL: "\n" | "\r" | "\f"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
/* IDENTIFIERS */</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;COMMA: ","&gt;
| &lt;OPAR: "("&gt;
| &lt;CPAR: ")"&gt;
| &lt;OBRA: "["&gt;
| &lt;CBRA: "]"&gt;
| &lt;OCBR: "{"&gt;
| &lt;CCBR: "}"&gt;
| &lt;COLON: ":"&gt;
| &lt;EQ: "=" | "!=" | "&gt;" | "&gt;=" | "&lt;" | "&lt;=" | "like"&gt;
| &lt;ELLIPSIS: "..."&gt;
| &lt;QUOTE_SINGLE: "\'"&gt;
| &lt;QUOTE_DOUBLE: "\""&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;FRAGMENT: "fragment"&gt;
| &lt;ON: "on"&gt;
| &lt;TRUE: "true"&gt;
| &lt;FALSE: "false"&gt;
| &lt;NULL: "null"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Number token
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;#ZERO: "0"&gt;
| &lt;#DIGIT_NONZERO: ["1"-"9"]&gt;
| &lt;#DIGIT: &lt;DIGIT_NONZERO&gt; | &lt;ZERO&gt;&gt;
| &lt;NUMBER_INTEGER: ("-")? ((&lt;ZERO&gt;)+ | &lt;DIGIT_NONZERO&gt; (&lt;DIGIT&gt;)*)&gt;
| &lt;NUMBER_DECIMAL: ("-")? ((&lt;ZERO&gt;)+ | &lt;DIGIT_NONZERO&gt; (&lt;DIGIT&gt;)*) "." (&lt;DIGIT&gt;)+ (["e","E"] ("+" | "-")? (&lt;DIGIT&gt;)+)?&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;STRING_SINGLE_EMPTY: "\'\'"&gt;
| &lt;STRING_DOUBLE_EMPTY: "\"\""&gt;
| &lt;#STRING_SINGLE_BODY: (~["\'","\\","\r","\n","\f","\t"] | "\\" ("r" | "n" | "f" | "\\" | "/" | "\'" | "b" | "t"))+&gt;
| &lt;#STRING_DOUBLE_BODY: (~["\"","\\","\r","\n","\f","\t"] | "\\" ("r" | "n" | "f" | "\\" | "/" | "\"" | "b" | "t"))+&gt;
| &lt;STRING_SINGLE_NONEMPTY: &lt;QUOTE_SINGLE&gt; &lt;STRING_SINGLE_BODY&gt; &lt;QUOTE_SINGLE&gt;&gt;
| &lt;STRING_DOUBLE_NONEMPTY: &lt;QUOTE_DOUBLE&gt; &lt;STRING_DOUBLE_BODY&gt; &lt;QUOTE_DOUBLE&gt;&gt;
| &lt;NAME_LITERAL: ("$" | "~" | "_" | ["A"-"Z"] | ["a"-"z"]) ("." | "-" | "_" | ["0"-"9"] | ["A"-"Z"] | ["a"-"z"])*&gt;
}

   </PRE>
  </TD>
 </TR>
</TABLE>
<H2 ALIGN=CENTER>NON-TERMINALS</H2>
<TABLE>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// dataQL
</PRE>
  </TD>
 </TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod1">dataQL</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;FRAGMENT&gt; <A HREF="#prod2">name</A> &lt;ON&gt; <A HREF="#prod3">grapthQuery</A> )* <A HREF="#prod3">grapthQuery</A> &lt;EOF&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod3">grapthQuery</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod4">udf</A> )? <A HREF="#prod5">queryBody</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod4">udf</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod2">name</A> &lt;OPAR&gt; ( <A HREF="#prod6">queryParam</A> ( &lt;COMMA&gt; <A HREF="#prod6">queryParam</A> )* )? &lt;CPAR&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod6">queryParam</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod7">stringValue</A> &lt;EQ&gt; ( <A HREF="#prod4">udf</A> | <A HREF="#prod8">DValue</A> )?</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod8">DValue</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod9">valueForBase</A> )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod3">grapthQuery</A> | <A HREF="#prod10">keyString</A> )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod9">valueForBase</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod11">nullValue</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod12">booleanValue</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod13">numberValue</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod7">stringValue</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod5">queryBody</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod14">queryArrayListBody</A> | <A HREF="#prod15">queryArrayValueBody</A> | <A HREF="#prod16">queryObjectBody</A> )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod14">queryArrayListBody</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;OBRA&gt; &lt;OCBR&gt; ( <A HREF="#prod17">queryFields</A> )? &lt;CCBR&gt; &lt;CBRA&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod15">queryArrayValueBody</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;OBRA&gt; ( ( <A HREF="#prod9">valueForBase</A> ) | ( <A HREF="#prod10">keyString</A> ) )? &lt;CBRA&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod16">queryObjectBody</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;OCBR&gt; ( <A HREF="#prod17">queryFields</A> )? &lt;CCBR&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod17">queryFields</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod18">queryField</A> ( &lt;COMMA&gt; <A HREF="#prod18">queryField</A> )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod18">queryField</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod7">stringValue</A> ( &lt;COLON&gt; <A HREF="#prod8">DValue</A> )?</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod2">name</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;NAME_LITERAL&gt; )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod7">stringValue</A> )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod10">keyString</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;NAME_LITERAL&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod7">stringValue</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( ( &lt;STRING_DOUBLE_EMPTY&gt; ) | ( &lt;STRING_DOUBLE_NONEMPTY&gt; ) | ( &lt;STRING_SINGLE_EMPTY&gt; ) | ( &lt;STRING_SINGLE_NONEMPTY&gt; ) )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod11">nullValue</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;NULL&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod12">booleanValue</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;TRUE&gt; )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;FALSE&gt; )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod13">numberValue</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;NUMBER_DECIMAL&gt; )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;NUMBER_INTEGER&gt; )</TD>
</TR>
</TABLE>
</BODY>
</HTML>
